import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
//testing
import Header from '../testing/Header.vue'
import Button from '../testing/Button.vue'
import Field from '../testing/Field.vue'
import Navbar from '../testing/Navbar.vue'
import Infinite from '../testing/Infinite'
import Tabcontainer from '../testing/Tabcontainer.vue'
import Tabbar from '../testing/Tabbar.vue'
import Vue01 from '../testing/Vue01.vue'
import Cart from '../testing/Cart.vue'
// views
import Register from '../views/Register.vue'
import Login from '../views/Login.vue'
import Index from '../views/Index.vue'
import Article from '../views/Article.vue'


Vue.use(VueRouter)

const routes = [
  {
    path:'/cart',
    component:Cart
  },
  {
    path:'/vue01',
    component:Vue01
  },
  {
    path:'/infinite',
    component:Infinite
  },
  {
    path:'/tabbar',
    component:Tabbar
  },
  {
    path:"/tabcontainer",
    component:Tabcontainer
  },
  {
    path:"/navbar",
    component:Navbar
  },
  {
    path:'/field',
    component:Field
  },
  {
    path:'/button',
    component:Button
  },
  {
    path:'/header',
    component:Header
  },
  {
    path: '/',
    name: 'Index',
    component: Index
  },
  {
    path:'/register',
    component:Register
  },
  {
    path:'/login',
    component:Login
  },
  {
    path:'/article/:id',
    component:Article
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
